#ifndef __XGraphicsSubSystem__h__included__
#define __XGraphicsSubSystem__h__included__

#include "core/Core.h"
#include "gui/iGraphicsSubsystem.h"

#include <X11/Xlib.h>

#include <map>
using std::map;

namespace neiderra {
	namespace gui {
	
		class GUIWindow;
		
		class XGraphicsSubsystem: public iGraphicsSubsystem
		{
			public:
				XGraphicsSubsystem(Core* core);
				virtual ~XGraphicsSubsystem();
				
				//! this function can't return anything exept XWindow pointer
				virtual GUIWindow* GetWindowPointer(Window w);
				
				virtual GUIWindow* createSystemWindow(const std::string& title);
				
				virtual GUIWindow* createSystemWindow(
													const std::string& title,
													int x, int y, int width, int height,
													GUIWindow* parent
												   ) { return createSystemWindow(title);}

				// fixme: deprecated, use iRenderTarget->makeCurrent()				
				virtual void makeCurrentWindow( GUIWindow* );
				
				virtual void update(double);
				
				virtual Display* GetDisplay();
			protected:
				map<Window, GUIWindow*> _windows;
				Display* _display;
		};
		
	}
}

#endif
